package br.com.sadim.web;

import java.awt.event.ActionEvent;
import java.io.Serializable;

import java.util.ArrayList;
import java.util.List;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

import org.primefaces.event.FlowEvent;


import br.com.sadim.diagnostico.Doenca;
import br.com.sadim.diagnostico.Sintoma;
import br.com.sadim.diagnostico.SintomaRN;
import br.com.sadim.hospital.Consulta;
import br.com.sadim.hospital.ConsultaRN;
import br.com.sadim.hospital.Usuario;
import br.com.sadim.hospital.UsuarioRN;
import br.com.sadim.paciente.PacienteRN;


@ManagedBean(name="wizardBean")
@ViewScoped
public class WizardBean implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String user = new String();
	private String street = new String();
	private Doenca doenca;
	private boolean skip;  


	public void init(){
		atribuirEstadoInicial();
	}
	
	private void atribuirEstadoInicial()
	{
		doenca = new Doenca();

	}
	
	public String getUser() {  
		return user;  
	}  

	public void setUser(String user) {  
		this.user = user;  
	}  

	public void save(ActionEvent actionEvent) {  
		FacesMessage msg = new FacesMessage("Successful", "Welcome :" + user);  
		FacesContext.getCurrentInstance().addMessage(null, msg);  
	}  

	public boolean isSkip() {  
		return skip;  
	}  

	public void setSkip(boolean skip) {  
		this.skip = skip;  
	}  

	public String onFlowProcess(FlowEvent event) {  

		if(skip) {  
			skip = false;   //reset in case user goes back  
			return "confirm";  
		}  
		else {  
			return event.getNewStep();  
		}  
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public Doenca getDoenca() {
		return doenca;
	}

	public void setDoenca(Doenca doenca) {
		this.doenca = doenca;
	}


}
